package fr.umlv.escape_ig.activity;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import fr.umlv.escape_ig.R;



public class MainActivity extends Activity {

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
	     // Pour cacher la barre de titre
	     requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		setContentView(R.layout.activity_main);
		
		//Creation du menu--------------------------------------------------
		//Bouton pour fermer l'application
		final Button close_button = (Button) findViewById(R.id.button_close);
		close_button.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		//Bouton pour lancer l'�cran de jeu
		final Button play_button = (Button) findViewById(R.id.button_game);
		play_button.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, Game.class);
				startActivity(intent);
			}
		});
		//Bouton pour lancer l'�cran du builder
		final Button builder_button = (Button) findViewById(R.id.button_builder);
		builder_button.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, EditorActivity.class);
				startActivity(intent);
			}
		});
		//Fin du menu-----------------------------------------------
		
		 // Pour cacher la barre de statut et donc mettre votre application en plein écran
	     getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
	 
	}
	
	

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
}
